﻿using Microsoft.AspNetCore.Mvc;

namespace MvcMovie.Controllers
{
    public class TestController : Controller
    {
        public IActionResult Index()
        {
            String username = HttpContext.Session.GetString("username");//读取登录凭证
            if (!String.IsNullOrEmpty(username))
            {
                ViewData["Message"] = username;
                return View();
            }
            else
            {
                return RedirectToAction("Index","Login");
            }
        }
    }
}
